package cuit.cx.groupcomm.service;

import java.util.List;

import cuit.cx.groupcomm.dao.BusinessDao;
import cuit.cx.groupcomm.dto.BassinessLoginDto;
import cuit.cx.groupcomm.model.Business;

public class BusinessService
{
	private BusinessDao businessDao;
	
	
	
	public BusinessDao getBusinessDao()
	{
		return businessDao;
	}

	public void setBusinessDao(BusinessDao businessDao)
	{
		this.businessDao = businessDao;
	}

	public BassinessLoginDto login(String email, String password)
	{
		BassinessLoginDto dto = new BassinessLoginDto();
		Business business = new Business();
		business.setBusinessEmail(email);
		business.setBusinessPassword(password);
		List<Business> list = businessDao.businessLogin(business);
		if (list != null && list.size() == 1)
		{
			dto.setResult(1);
			dto.setBusiness(list.get(0));
		}
		return dto;
	}

}
